package com.engine4cloud.tdf.common.core.util.lambda;

import java.util.Objects;
import java.util.function.Consumer;

/**
 * 处理
 *
 * @author wenjie
 * @date 2024/03/28
 */
public interface Actions {

    static <T> void accept(T s, Consumer<T> c) {
        if (Objects.nonNull(s)) {
            c.accept(s);
        }
    }

    static void apply(boolean condition, Runnable action) {
        if (condition) {
            action.run();
        }
    }
}
